package o;

import android.content.Context;
import android.content.Intent;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appmarket.service.settings.bean.BaseSettingCardBean;
import com.huawei.hwid.core.constants.HwAccountConstants;

public class egw {
    private static final Object ˊ = new Object();
    private static egw ॱ;

    public static egw ˏ() {
        egw o_egw;
        synchronized (ˊ) {
            if (ॱ == null) {
                ॱ = new egw();
            }
            o_egw = ॱ;
        }
        return o_egw;
    }

    public void ˎ(cia o_cia, BaseSettingCardBean baseSettingCardBean) {
        Object obj = null;
        if (o_cia == null || baseSettingCardBean == null || baseSettingCardBean.ꜞ() == -1) {
            String str = "SettingsManager";
            StringBuilder append = new StringBuilder().append("updateCard error, cardDataProvider is ").append(o_cia == null ? null : "not null").append(",bean is ");
            if (baseSettingCardBean != null) {
                obj = Integer.valueOf(baseSettingCardBean.ꜞ());
            }
            Logger.e(str, append.append(obj).toString());
            return;
        }
        for (chz ˏ : o_cia.ʻॱ()) {
            for (CardBean cardBean : ˏ.ˏ()) {
                if (cardBean instanceof BaseSettingCardBean) {
                    BaseSettingCardBean baseSettingCardBean2 = (BaseSettingCardBean) cardBean;
                    baseSettingCardBean2.ʽ(baseSettingCardBean.ꜞ());
                    baseSettingCardBean2.ʼ(baseSettingCardBean.ㆍ());
                    baseSettingCardBean2.ˎ(baseSettingCardBean.ꓸ());
                } else {
                    Logger.e("SettingsManager", "cardBean is not instanceof BaseSettingCardBean");
                }
            }
        }
    }

    public cia ˏ(Context context, int i) {
        return che.ˎ().ˎ(context, i);
    }

    public void ˋ(Context context, cia o_cia, int i) {
        che.ˎ().ˊ(context, o_cia, i);
    }

    public void ˋ() {
        Context ˋ = ContentManager.getInstant().getContext();
        Intent launchIntentForPackage = ˋ.getPackageManager().getLaunchIntentForPackage(ˋ.getPackageName());
        launchIntentForPackage.addFlags(HwAccountConstants.FLAG_TRANSLUCENT_STATUS);
        launchIntentForPackage.addFlags(268435456);
        launchIntentForPackage.putExtra("from_restart", true);
        ˋ.startActivity(launchIntentForPackage);
        launchIntentForPackage = new Intent();
        launchIntentForPackage.setAction("com.huawei.systemmanager.action.CHANGE_HOME_COUNTRY");
        ll ˏ = ll.ˏ(ˋ);
        if (ˏ != null) {
            ˏ.ˋ(launchIntentForPackage);
        }
    }
}
